const path = require("path");
const fs = require("fs");
const ROOT_PATH = process.cwd();
const defaultDeep = require("lodash/defaultsDeep");

const copyUserConfig = defaultDeep(
  {},
  fs.existsSync(path.resolve(ROOT_PATH, "./configs/user.js"))
    ? require(path.resolve(ROOT_PATH, "./configs/user.js"))
    : {}
);

module.exports = defaultDeep(
  copyUserConfig,
  require(path.resolve(ROOT_PATH, "./configs/default.js"))
);
